import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/Login'
import Home from '@/views/Home'
import Welcome from '@/views/Welcome'
import Users from '@/views/Users'
import Roles from '@/views/power/Roles'
import Rights from '@/views/power/Rights'
import Categories from '@/views/goods/categories'
import Pamrsi from '@/views/goods/Parmsi'
import Addgoods from '@/views/goods/addgoods'
Vue.use(Router)

export default new Router({
  routes: [
    {
      name: 'Login',
      path: '/login',
      component: Login
    },
    {
      name: 'home',
      path: '/',
      component: Home,
      redirect: {name: 'welcome'},
      children: [
        {
          name: 'welcome',
          path: 'welcome',
          component: Welcome
        },
        {
          name: 'users',
          path: 'users',
          component: Users
        },
        {
          name: 'roles',
          path: 'roles',
          component: Roles
        },
        {
          name: 'rights',
          path: 'rights',
          component: Rights
        },
        {
          name: 'categories',
          path: 'categories',
          component: Categories
        },
        {
          name: 'goods',
          path: 'goods',
          component: Pamrsi
        },
        {
          name: 'addgoods',
          path: 'addgoods',
          component: Addgoods
        }
      ]
    }
  ]
})
